#ifndef __DC_MOTOR_H_
#define __DC_MOTOR_H_

#include "MyApplication.h"

//定义枚举类型
//电机状态
typedef enum
{
    DC_Start_Status = (uint8_t)0,
    DC_Stop_Status  = (uint8_t)1
}DC_Status_t;

//转动方向
typedef enum
{
    DC_Forward_Status  = (uint8_t)0,
    DC_Reverse_Status  = (uint8_t)1
}DC_Direction_t;

//速度
typedef enum
{
    DC_Speed_20   = (uint8_t)20,
    DC_Speed_30   = (uint8_t)30,
    DC_Speed_40   = (uint8_t)40,
    DC_Speed_50   = (uint8_t)50,
    DC_Speed_60   = (uint8_t)60,
    DC_Speed_70   = (uint8_t)70,
    DC_Speed_80   = (uint8_t)80,
    DC_Speed_90   = (uint8_t)90,
    DC_Speed_100  = (uint8_t)100,
}DC_Speed_t;

typedef enum
{
    DC_speed_up    = (uint8_t)0,   //加速
    DC_speed_down  = (uint8_t)1    //减速
}DC_Speed_Change_t;

//定义结构体类型
typedef struct
{
    DC_Status_t Status;
    DC_Direction_t Direction;
    DC_Speed_t Speed;

    void (*Start)(void);
    void (*Stop)(void);
    void (*Direction_Adjust)(void);
    void (*Speed_Adjust)(Speed_Change_t );
}DC_Motor_t;

/* extern variables-----------------------------------------------------------*/
extern DC_Motor_t DC_Motor;
/* extern function prototypes-------------------------------------------------*/ 

#endif
/********************************************************
  End Of File
********************************************************/
